package com.enba.mallapi.module.order;

import com.enba.boot.core.base.Result;
import com.enba.mall.core.orders.order.req.OrderSendGoodsReq;
import com.enba.mall.core.orders.order.service.IOrderService;
import com.enba.mallapi.annotation.DistributedLock;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;

@Api(tags = "订单管理")
@RestController
@RequestMapping("/api/order")
public class PlatformOrderController {

  @Resource private IOrderService orderService;

  @PostMapping("/send")
  @ApiOperation("发货")
  @DistributedLock(tips = "发货中，请勿重复操作")
  public Result<Boolean> sendGoods(@RequestBody @Validated OrderSendGoodsReq req) {
    orderService.sendGoods(req);
    return Result.success(true);
  }
}
